package com.ywu.api.spi.spi;

import com.ywu.api.spi.dto.ApiRouterDto;
import com.ywu.api.spi.entity.ApiRouterEntity;
import com.ywu.common.result.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "YWU-API")
public interface ApiRouterSpi {
    @PostMapping("/ywu/api/router.add.info")
    CommonResult<Object> add(@RequestBody ApiRouterDto apiRouterDto);

    @PostMapping("/ywu/api/api.route.info")
    CommonResult<Object> apiRouteInfoQuery(@RequestBody ApiRouterDto apiRouterDto);

    @PostMapping("/ywu/api/api.route.info.for.spi")
    CommonResult<ApiRouterEntity> apiRouteInfoQueryForSpi(@RequestBody ApiRouterDto apiRouterDto);

    @PostMapping("/ywu/api/api.route.query.all.routes.spi")
    CommonResult<List<ApiRouterEntity>> queryAllRoutesSpi();

    @PostMapping("/ywu/api/api.query.by.code.for.spi")
    CommonResult<List<ApiRouterEntity>> queryApiByCode(@RequestBody List<ApiRouterDto> apiRouterDto);
}
